package com.teamwings.ctrls.formCtrls.noField;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.teamwings.common.aspect.annotation.FormControl;
import com.teamwings.common.constant.FormConstant;
import com.teamwings.common.vo.Result;
import com.teamwings.ctrls.FormComponent;
import com.teamwings.modules.design.vo.FormVo;
import com.teamwings.modules.page.service.IPageService;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@FormControl(type = "oa_button_group", needField = false)
@Data
public class ButtonGroup extends FormComponent {

    public ButtonGroup() {
        super();
        this.type = "oa_button_group";
    }

    @Override
    public Result<?> trigger(
            FormConstant.TRIGGER_TYPE type,
            IPageService pageService,
            FormVo formDesignCode,
            Object paramsData
    ) {
        JSONObject jo = JSON.parseObject(paramsData + "");
        Integer listType = jo.getInteger("listType");

        if (type == FormConstant.TRIGGER_TYPE.CTRL_HANDLER) {
//            if (listType.equals(0)) {
//
//            } else if(listType.equals(1)) {
//
//            } else if(listType.equals(2)) {
//
//            }
        }
        return Result.error("参数有误，查询失败。");
    }


}
